package com.baizhi.cmfzdemo.controller;

import com.baizhi.cmfzdemo.entity.CmfzGuru;
import com.baizhi.cmfzdemo.entity.CmfzLesson;
import com.baizhi.cmfzdemo.service.CmfzGuruService;
import com.baizhi.cmfzdemo.service.CmfzLessonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by 54433 on 2019/4/4.
 */
@Controller
@RequestMapping("/cmfzLesson")
public class CmfzLessonController {
    @Autowired
    private CmfzLessonService cmfzLessonService;

    //展示所有
    @RequestMapping("/queryAllCmfzLesson")
    @ResponseBody
    public Map queryAllCmfzLesson(int page,int rows){
        System.out.println(cmfzLessonService.queryAllCmfzLesson(page,rows));
        return cmfzLessonService.queryAllCmfzLesson(page,rows);
    }
    @RequestMapping("/deleteCmfzLesson")
    @ResponseBody
    public Map deleteCmfzLesson(int [] ids){
        return cmfzLessonService.deleteCmfzLesson(ids);
    }
    @RequestMapping("/insertCmfzLesson")
    @ResponseBody
    public Map insertCmfzLesson(CmfzLesson cmfzLesson){
        return cmfzLessonService.addCmfzLesson(cmfzLesson);
    }
    @RequestMapping("/updateCmfzLesson")
    @ResponseBody
    public Map updateCmfzLesson(CmfzLesson cmfzLesson){
        return cmfzLessonService.updateCmfzLesson(cmfzLesson);
    }
}
